test: fix the two tests that only failed on Linux - #537
Merged
Conversation
Both passed on every laptop and failed on every runner, which is the shape of bug the pre-push gate cannot see: it runs CI's command list on this machine, not on CI's machine. `script` lends the colouriser a pty so the "is this a terminal" branch can be exercised at all, and its argument order is reversed between the platforms this repository builds on: BSD takes the typescript file first and the command after it, util-linux wants the command behind `-c` and the file last. Written for BSD only, it turned into a failure with no message on Linux. The mesh window test slept 150 ms and then asserted. `_add` writes fire-and-forget and only adopts a message once the insert answers, so both halves of what the test checks land after the packet is handed over — a fixed delay is a guess about how fast the machine is. It waits for the store now. The tail of a 320-message burst was arriving after the test had closed the database, which reported as `This database has already been closed` thirteen times and then a length mismatch. `tool/commit.sh` stops claiming "this is what CI will do" and names the platform it actually checked.
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 3 selected item(s). |
Comment on lines
81
to
83
| test('keeps the newest messages first', () async { | ||
| final (controller, service, _) = await makeController(); | ||
| for (var i = 0; i < 10; i++) { |
There was a problem hiding this comment.
在 'keeps the newest messages first' 測試案例中,store 被解構為 _,導致後續呼叫 drained(store, ...) 時會出現編譯錯誤(Undefined name 'store')。
Suggestion:
Suggested change
| test('keeps the newest messages first', () async { | |
| final (controller, service, _) = await makeController(); | |
| for (var i = 0; i < 10; i++) { | |
| test('keeps the newest messages first', () async { | |
| final (controller, service, store) = await makeController(); | |
| for (var i = 0; i < 10; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both passed on every laptop and failed on every runner, which is the shape of bug the pre-push gate cannot see: it runs CI's command list on this machine, not on CI's machine.
scriptlends the colouriser a pty so the "is this a terminal" branch can be exercised at all, and its argument order is reversed between the platforms this repository builds on: BSD takes the typescript file first and the command after it, util-linux wants the command behind-cand the file last. Written for BSD only, it turned into a failure with no message on Linux.The mesh window test slept 150 ms and then asserted.
_addwrites fire-and-forget and only adopts a message once the insert answers, so both halves of what the test checks land after the packet is handed over — a fixed delay is a guess about how fast the machine is. It waits for the store now. The tail of a 320-message burst was arriving after the test had closed the database, which reported asThis database has already been closedthirteen times and then a length mismatch.tool/commit.shstops claiming "this is what CI will do" and names the platform it actually checked.這個 PR 做了什麼
相關 issue
怎麼驗
檢查清單
tool/check/commits.sh origin/main..HEAD通過—— commit 訊息就是更新日誌,格式見 commit.md
mise exec -- flutter analyze與mise exec -- flutter test通過AppLocalizations,沒有寫死AppSpacing/AppRadius/AppMotion,深色模式看過,文字對比度可接受